package com.bwie.controller;
import com.bwie.pojo.Order;
import com.bwie.pojo.ProdInfo;
import com.bwie.service.Impl.OrderServiceImpl;
import com.bwie.service.OrderService;
import com.bwie.utils.R;
import com.bwie.vo.PageInfoVo;
import org.springframework.web.bind.annotation.*;

import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

/**
* 订单表(tb_order)表控制层
*
* @author xxxxx
*/
@RestController
@RequestMapping("/prod/order")
public class OrderController {
/**
* 服务对象
*/
    @Autowired
    private OrderService orderService;

    /**
     * 订单列表,夺宝cha
     * @param pageInfoVo
     * @return
     */
    @PostMapping(value = "/getOrderList")
    public R getOrderList(
            @RequestBody PageInfoVo pageInfoVo
            ){
        return orderService.getOrderList(pageInfoVo);
    }

    /**
     * 批量删除
     * @param ids
     * @return
     */
    @PostMapping(value = "/deleteOrderBatch")
    public R deleteOrderBatch(
            @RequestBody List<Integer> ids
            ){
        return orderService.deleteOrderBatch(ids);
    }

    /**
     * 导出
     * @return
     */
    @GetMapping(value = "getExel")
    public R getExel(){
        return orderService.getExel();
    }

    /**
     * 商品下拉框
     * @return
     */
    @PostMapping(value = "getProdInfoList")
    public R getProdInfoList(){
        return orderService.getProdInfoList();
    }
    @PostMapping(value = "addProdInfoList")
    public R addProdInfoList(
        @RequestBody List<ProdInfo> prodInfoList
    ){
        return orderService.addProdInfoList(prodInfoList);
    }
}
